import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';


class MethodChannelManager{


  //flutter调用原生的实例
  static const platform = MethodChannel('com.topnet.xxx');

  //可以写一些flutter调用原生的方法
  void sendMsg2Android(){
    platform.invokeMethod('xxx');
  }









  //有原生调用flutter方法时，需提前调用初始化方法
  static void initChannel() {
    platform.setMethodCallHandler(platformCallHandler);
  }

  static Future<dynamic> platformCallHandler(MethodCall call) async{
    switch(call.method) {
      case "example":  //弹出账号互顶弹窗

        break ;


    }
  }

}
